<?php

class Module {

	var $action = 'default';

	var $prefix = 'action';

	var $module = 'index';

	function Module ($module) {
		if(isset($_GET['action']))
			$this->action = $_GET['action'];

		$this->module = $module;
		$method = $this->prefix . $this->action;
		if(method_exists($this, $method)) 
			call_user_func(array(&$this, $method));
	}

	function actionDefault() {
		echo 'it\'s default action';
	}

	function _tpl() {
		return ROOT . "tpl/{$this->module}/{$this->action}.tpl.php";
	}

}

?>
